import html
import json
from urllib.parse import unquote


def cookie_to_dict(cookie_str):
  cookies = cookie_str.split('; ')
  # Create a dictionary to hold the cookies
  cookie_dict = {}
  # Populate the dictionary
  for cookie in cookies:
    key, value = cookie.split('=', 1)  # Split only on the first '='
    cookie_dict[key] = value

  # Convert the dictionary to JSON
  cookie_json = json.dumps(cookie_dict, indent=4)
  return cookie_json
